﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ComicInfo" nillable="true" type="ComicInfo" />
  <xs:complexType name="ComicInfo">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Title" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Series" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Number" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="-1" name="Count" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" default="-1" name="Volume" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="AlternateSeries" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="AlternateNumber" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="-1" name="AlternateCount" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Summary" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Notes" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="-1" name="Year" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" default="-1" name="Month" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Writer" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Penciller" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Inker" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Colorist" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Letterer" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="CoverArtist" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Editor" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Publisher" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Imprint" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Genre" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Web" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="0" name="PageCount" type="xs:int" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="LanguageISO" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Format" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="BlackAndWhite" type="YesNo" />
      <xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="Manga" type="YesNo" />
      <xs:element minOccurs="0" maxOccurs="1" name="Pages" type="ArrayOfComicPageInfo" />
      <!-- Proposed -->
      <xs:element minOccurs="0" maxOccurs="1" name="ID" type="guid" />
      <xs:element minOccurs="0" maxOccurs="1" name="Translation" type="guid" />
      <xs:element minOccurs="0" maxOccurs="1" name="Version" type="guid" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="TranslationTitle" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Translator" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" default="" name="Homepage" type="xs:string" />
      <xs:element minOccurs="0" maxOccurs="1" name="Tags" type="ArrayOfTags" />
      <xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="Type" type="ComicType" />
      <!-- /Proposed -->
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="YesNo">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Unknown" />
      <xs:enumeration value="No" />
      <xs:enumeration value="Yes" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ArrayOfComicPageInfo">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Page" nillable="true" type="ComicPageInfo" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ComicPageInfo">
    <!-- Proposed -->
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="Panels" type="ArrayOfPanels" />
      <xs:element minOccurs="0" maxOccurs="1" name="Graphics" type="GraphicsInfo" />
      <xs:element minOccurs="0" maxOccurs="1" name="TextData" type="TextData" />
    </xs:sequence>
    <!-- /Proposed -->
    <xs:attribute name="Image" type="xs:int" use="required" />
    <xs:attribute default="Story" name="Type" type="ComicPageType" />
    <xs:attribute default="false" name="DoublePage" type="xs:boolean" />
    <xs:attribute default="0" name="ImageSize" type="xs:long" />
    <xs:attribute default="" name="Key" type="xs:string" />
    <xs:attribute default="-1" name="ImageWidth" type="xs:int" />
    <xs:attribute default="-1" name="ImageHeight" type="xs:int" />
    <!-- Proposed -->
    <xs:attribute name="ImageHash" type="sha256" />
    <xs:attribute name="URL" type="xs:string" />
    <xs:attribute name="Date" type="xs:date" />
    <!-- /Proposed -->
  </xs:complexType>
  <xs:simpleType name="ComicPageType">
    <xs:list>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="FrontCover" />
          <xs:enumeration value="InnerCover" />
          <xs:enumeration value="Roundup" />
          <xs:enumeration value="Story" />
          <xs:enumeration value="Advertisment" />
          <xs:enumeration value="Editorial" />
          <xs:enumeration value="Letters" />
          <xs:enumeration value="Preview" />
          <xs:enumeration value="BackCover" />
          <xs:enumeration value="Other" />
          <xs:enumeration value="Deleted" />
          <!-- Proposed -->
          <xs:enumeration value="DailyStrip" />
          <xs:enumeration value="SundayStrip" />
          <!-- /Proposed -->
        </xs:restriction>
      </xs:simpleType>
    </xs:list>
  </xs:simpleType>
  <!-- Proposed -->
  <xs:simpleType name="guid">
    <xs:restriction base="xs:string">
      <xs:pattern value="[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="sha256">
    <xs:restriction base="xs:string">
      <xs:pattern value="[a-fA-F0-9]{64}"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ArrayOfTags">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Tag" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="ComicType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Unknown" />
      <xs:enumeration value="ComicBook" />
      <xs:enumeration value="ComicStrip" />
      <xs:enumeration value="WebComic" />
      <xs:enumeration value="GraphicNovel" />
      <xs:enumeration value="Manga" />
      <xs:enumeration value="Yonkoma" />
      <xs:enumeration value="Lubok" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ArrayOfPanels">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Panel" type="PanelInfo" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PanelInfo">
    <xs:attributeGroup ref="rectangle" />
  </xs:complexType>
  <xs:complexType name="GraphicsInfo">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="rect" type="rectInfo" />
      <xs:element name="path" type="pathInfo" />
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="rectInfo">
    <xs:attributeGroup ref="rectangle" />
    <xs:attribute ref="fill" />
    <xs:attributeGroup ref="stroke" />
  </xs:complexType>
  <xs:complexType name="pathInfo">
    <xs:attribute name="d" type="xs:string" use="required"/>
    <xs:attribute ref="fill" />
    <xs:attributeGroup ref="stroke" />
  </xs:complexType>
  <xs:attributeGroup name="rectangle">
    <xs:attributeGroup ref="point" />
    <xs:attribute name="width" type="xs:int" use="required" />
    <xs:attribute name="height" type="xs:int" use="required" />
  </xs:attributeGroup>
  <xs:attributeGroup name="point">
    <xs:attribute name="x" type="xs:int" use="required" />
    <xs:attribute name="y" type="xs:int" use="required" />
  </xs:attributeGroup>
  <xs:attribute default="none" name="fill" type="xs:string"/>
  <xs:attributeGroup name="stroke">
    <xs:attribute default="none" name="stroke" type="xs:string" />
    <xs:attribute default="1" name="stroke-width" type="xs:decimal" />
  </xs:attributeGroup>
  <xs:attribute name="transform" type="xs:string"/>
  <xs:complexType name="TextData">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="TextArea" type="TextArea" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TextArea">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="text" type="textInfo" />
    </xs:sequence>
    <xs:attribute ref="fill" />
    <xs:attributeGroup ref="stroke" />
    <xs:attribute ref="transform" />
    <xs:attributeGroup ref="textGroup" />
    <xs:attributeGroup ref="fontGroup" />
  </xs:complexType>
  <xs:complexType name="textInfo" mixed="true">
    <xs:attributeGroup ref="point" />
    <xs:attribute ref="fill" />
    <xs:attributeGroup ref="stroke" />
    <xs:attribute ref="transform" />
    <xs:attributeGroup ref="textGroup" />
    <xs:attributeGroup ref="fontGroup" />
  </xs:complexType>
  <xs:complexType name="textSpan" mixed="true">
    <xs:attribute ref="fill" />
    <xs:attributeGroup ref="stroke" />
    <xs:attributeGroup ref="fontGroup" />
  </xs:complexType>
  <xs:attributeGroup name="textGroup">
    <xs:attribute name="writing-mode" type="writingMode" />
    <xs:attribute name="glyph-orientation-vertical" type="glyphOrientationVertical" />
    <xs:attribute name="dominant-baseline" type="baseline" />
  </xs:attributeGroup>
  <xs:simpleType name="writingMode">
    <xs:restriction base="xs:string">
      <xs:enumeration value="lr" />
      <xs:enumeration value="rl" />
      <xs:enumeration value="tb" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="glyphOrientationVertical">
    <xs:restriction base="xs:string">
      <xs:enumeration value="auto" />
      <xs:enumeration value="0" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="baseline">
    <xs:restriction base="xs:string">
      <xs:enumeration value="alphabetic" />
      <xs:enumeration value="middle" />
      <xs:enumeration value="text-after-edge" />
      <xs:enumeration value="text-before-edge" />
    </xs:restriction>
  </xs:simpleType>
  <xs:attributeGroup name="fontGroup">
    <xs:attribute name="font-family" type="xs:string" />
    <xs:attribute name="font-size" type="xs:decimal" />
    <xs:attribute name="font-weight" type="fontWeight" />
    <xs:attribute name="font-style" type="fontStyle" />
  </xs:attributeGroup>
  <xs:simpleType name="fontWeight">
    <xs:restriction base="xs:string">
      <xs:enumeration value="normal" />
      <xs:enumeration value="bold" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="fontStyle">
    <xs:restriction base="xs:string">
      <xs:enumeration value="normal" />
      <xs:enumeration value="italic" />
    </xs:restriction>
  </xs:simpleType>
  <!-- /Proposed -->
</xs:schema>